{include file="common/header.tpl"}
<script language="javascript">
{literal}
	function resizeClick()
	{
		if($('resize').checked)
		{
			$('w').disabled = '';
			$('h').disabled = '';
		}
		else
		{
			$('w').disabled = 'disabled';
			$('h').disabled = 'disabled';
		}
	}
{/literal}
</script>
<body>
<div id="wrapper">
{include file="common/toptab.tpl"}

<div id="option_response" class="wrap ajaxResponse"></div>

<!-- Build the page here -->
<div class="wrap" style="min-height: 400px">

{if $message != null}
	<div id="ajaxResponse1" class="ajaxResponse fade" style="display:block">{$message}</div>
{/if}
<h2>Datei-Manager</h2>
<form enctype="multipart/form-data" action="" method="POST">
    <!-- MAX_FILE_SIZE must precede the file input field -->
    <input type="hidden" name="MAX_FILE_SIZE" value="3145728" />
    Datei: <input size="100" name="uploadfile" type="file" />
    <br />
     Maximal 3 MB.
    <br />
    <label for="resize">
    <input onChange="resizeClick()" type="checkbox" id="resize" name="resize" value="1" />
    	Resize Bild</label>
    &nbsp;&nbsp;&nbsp;
    <div id="g_size">
	    <label for="w">Breite
	    <input disabled type="text" id="w" name="width" value="100" size="3"/></label>
	    &nbsp;&nbsp;&nbsp;
	    <label for="h">H&ouml;he
	    <input disabled type="text" id="h" name="height" value="200" size="3"/></label>
	</div>
    <p class="submit" align = "right">
    <input type="submit" value="Hochladen" />
    </p>
</form>
<br />
<form name="review" id="review" method="post" action="?module={$smarty.get.module}{if $smarty.get.list}&amp;list={$smarty.get.list}{/if}">
	<input type="hidden" name="changeShowImg" value="changeShowImg">
	<label for="showImg">
	<input {if $smarty.session.showImg == "1"} checked {/if} id="showImg" name="showImg" type="checkbox" onClick="review.submit()" value="1"/>
	Bild anzeigen</label>
</form>
<table class="widefat">
		<thead>
		<tr>
	        <th scope="col">Name</th>
	        <th scope="col">Pfad</th>
	        <th scope="col" style="text-align: center">Aktionen</th>
		</tr>
		</thead>
		<tbody id="table">
		{foreach name=cat from=$FILES.data item=item}
			
            {if $item.image != "1" }
            <tr id="" class="{cycle values=,alternate}">
				<th scope='row'>
				{if $item.image != "1" && $smarty.session.showImg == "1"}
					<img src="{$item.img}" width="64" height="64" /><br />
				{else}
					{$item.name}
				{/if}
				</th>
				<td>{$item.link}</td>
				<td style="text-align: center">
					<a href="?module={$smarty.get.module}&del={if $item.type!=''}{$item.type}/{/if}{$item.name}" class='delete'><img src="../view/admin/images/object_delete.png" alt="Delete" /></a>
				</td>
			</tr>
            {/if}
		{/foreach}
		</tbody>
</table>
{if $FILES.data != NULL}
    <div>			
              <div style="width:300px; float:left"> 
                  Seiten : {$FILES.TOTAL} von {$FILES.TOTALDATA}
              </div>			
              <div style="width:300px; text-align:right; float:right" >{$FILES.FIRST} {$FILES.PRE}&nbsp;{$FILES.LISTPAGE} von &nbsp; {$FILES.TOTALPAGE} &nbsp;                   
                  <select onChange="javascript:window.location='{$FILES.LINK}&{$FILES.PATHNAME}='+this.value">
                    {$FILES.COMBOPAGE}                     
                  </select>&nbsp;{$FILES.NEXT} {$FILES.LAST}         
              </div>
              <div style="clear:both"></div>		
    </div>	     
    {/if}
</div>
</div>
</body>